const Sequelize = require('sequelize');
const baseModel = require('../baseModel');

class openedModel extends baseModel{
  constructor(){
    super('opened',{
      // 学员ID
      stu_id:{
        type: Sequelize.INTEGER,
        allowNull: false,
        primaryKey: true
      },
      // 关卡ID
      course_id:{
        type: Sequelize.INTEGER,
        allowNull: false
      },
      // 作品ID
      work_id:{
        type: Sequelize.INTEGER,
        allowNull: false,
        primaryKey: true
      },
      createdAt:{
        type: Sequelize.DATE,
        allowNull: false
      },
      updatedAt:{
        type: Sequelize.DATE,
        allowNull: false
      }
    });
    this.model = super.getModel();
    this.model.sync();
  }
}

module.exports = new openedModel();
